//
//  YMNavigationBar.m
//  LantaiyuanBus
//
//  Created by lantaiyuan on 16/9/2.
//  Copyright © 2016年 lantaiyuan. All rights reserved.
//

#import "YMNavigationBar.h"

@interface YMNavigationBar ()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@end

@implementation YMNavigationBar

- (void)awakeFromNib{
    [super awakeFromNib];
}

-(UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}

- (void)setTitle:(NSString *)title{
    _title = title;
    _titleLabel.text = title;
}

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([YMNavigationBar class]) owner:nil options:nil].lastObject;
        self.frame = frame;
    }
    return self;
}

- (void)setRightView:(UIView *)rightView{
    _rightView = rightView;
}

- (void)setLeftView:(UIView *)leftView{
    _leftView = leftView;
}

- (void)setTitleView:(UIView *)titleView{
    _titleView = titleView;
}

- (void)hiddenAllSubviews{
    _leftView.hidden = YES;
    _rightView.hidden = YES;
    _titleView.hidden = YES;
}

@end
